package com.py.credit.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.py.credit.dao.DynamicnewsDao;
import com.py.credit.entity.Dynamicnews;
import com.py.credit.service.DynamicnewsService;
import com.py.framework.core.common.Page;

@Service
public class DynamicnewsServiceImpl implements DynamicnewsService {

	@Autowired
	private DynamicnewsDao dynamicnewsDao;

	@Override
	@Transactional
	public void addDynamicnews(Dynamicnews dynamicnews) {
		dynamicnewsDao.addDynamicnews(dynamicnews);
	}

	@Override
	@Transactional
	public void deleteDynamicnewsById(Integer id) {
		dynamicnewsDao.deleteDynamicnewsById(id);
	}

	@Override
	@Transactional
	public void updateDynamicnewsById(Dynamicnews dynamicnews) {
		dynamicnewsDao.updateDynamicnewsById(dynamicnews);
	}

	@Override
	public List<Dynamicnews> selectDynamicnewsByLikeForPage(Dynamicnews dynamicnews, Page page) {
		return dynamicnewsDao.selectDynamicnewsByLikeForPage(dynamicnews, page);
	}

	@Override
	public Dynamicnews selectDynamicnewsById(Integer id) {
		return dynamicnewsDao.selectDynamicnewsById(id);
	}

	@Override
	public void updateDynamicnewsCount(Dynamicnews dynamicnews) {
		dynamicnewsDao.updateDynamicnewsCount(dynamicnews);
	}

}
